import time
from sys import argv
import sys


def main():
    if len(argv) < 2:
        print("argv's len is less 1.", argv)
        sys.exit("args error, required file path.")
    list_r = []
    start = time.time()
    print("start at ", start)
    print("file is ", argv[1])
    with open(argv[1], 'r') as with_file:
        line = with_file.readline()
        while line:
            list_r.append(line)
            line = with_file.readline()
    length = len(list_r)
    print("total length: ", length)
    list_r.sort()
    for i in range(length-1):
        if list_r[i] == list_r[i+1]:
            print(list_r[i], "=", list_r[i+1])

    end = time.time()
    print("cost times: ", end-start, "s")


if __name__ == '__main__':
    main()
